package shiyan;

public class Prime {

    public static void main(String[] args) {
        int count =0 ;
        for (int i=2;i<=100000;i++){
            boolean temp=true;
            for (int j=2;j<=Math.sqrt(i);j++){
                if (i%j==0)
                {
                    temp=false;
                    break;
                }
            }
            if (temp){
                System.out.print(i+" ");
                if (count%5==0){
                    System.out.println();
                    count=0;
                }
                count++;
            }
        }
    }
}
